<style>
.fe-floatback a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #fff;
    color: #333;
    line-height: 1.6rem;
    opacity: 0.6;
}
.fe-floatback a .icon {
    color: #333;
    font-size: 1.2rem;
    height: 1.6rem;
}
.btn.btn-danger-o {
    background: transparent;
    color: #fbce2a;
    border: 1px solid #fbce2a;
}
.order-express-page .express-list .fui-list-inner {
    padding: 0.5rem 1rem;
}
.order-express-page .express-list .fui-list .fui-list-inner:before {
    border-left: 0.1rem solid #c9c9c9;
    top: 0;
    left: 0.2rem;
    z-index: 108;
}
.order-express-page .express-list .fui-list-inner .text.step:before {
    content: " ";
    width: 0;
    height: 0.3rem;
    width: 0.3rem;
    background: #aaa;
    border: 0.1rem solid #c9c9c9;
    border-radius: 0.5rem;
    position: absolute;
    top: 0.25rem;
    left: -0.93rem;
    z-index: 108;
}
</style>
<div class="fui-page fui-page-current page-goods-list" style="background:none">
<div class="fe-floatback" style="top:0.5rem;left:0.5rem">
		 <a class="back" ng-click="goback();">
		<i  class="icon icon-back"></i>
		</a>
</div>
<div class='fui-content' style="top:0;background: linear-gradient(#fbce2a, #fcd7f7);padding-bottom:0">
	<div style="padding:2rem;">
		<div class="top" style="margin-bottom:-1.3rem;z-index:108">
			<div class="c">
					<img style="width:3rem;height:3rem;border-radius:100%" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/no-wxapp.png'}}"  />
			</div>
		</div>
		<div class="fui-code" style="background: linear-gradient(#fdf5d8, #fcd7f7);border-radius: 0.5rem;padding-bottom:1rem">		
			 <div class="fui-line-title" style="padding-top:1.3rem" ng-click="tool.clip(pagedata.member.snmid)">
					<div>{{pagedata.member.nickname}}</div>
					<div style="color:#999;font-size:0.7rem">{{pagedata.isfromuser==1?'他':'我'}}的邀请码：{{pagedata.member.snmid}} <i class="icon icon-copy" style="font-size:0.6rem"></i></div>
			</div>
			 <div class="c">
                <div style="margin-left:auto;margin-right:auto;padding:0.5rem;border-radius:0.2rem;">
					<img style="width:9rem;height:9rem;border-radius:0.5rem" src="{{tomedia(pagedata.qrcode) || '../core/resource/images/no-wxapp.png'}}"  />
                </div>
				<span class="bold" style="color:#999;font-size:13px">{{pagedata.app.title}}</span> 
			</div>
			<div class="fui-line-title">
				<div class="text text-danger bold" style="margin-bottom: -8px;color:#fff;">
					<span style="color:#999;font-size:13px">请用手机浏览器扫上面APP二维码</span> 
				</div>
				<div class="text text-danger" style="margin-bottom: -8px;color:#fff;">
					<span style="color:#999;font-size:13px">可以将二维分享给您的好友，邀请TA加入！</span> 
				</div>
			</div>
			<div class="content-empty" style="margin-top:0.5rem;">
				<a ng-if="pagedata.jy_poster==1" href="javascript:;" ng-click="pagedata.showposter=true;pagedata.upposter()" class='btn btn-sm btn-danger-o external'style="border-radius: 100px;width:  9rem;font-size: .75rem">生成海报</a>
				<a ng-if="pagedata.jy_poster!=1" href="javascript:;" onclick="$('#showsharecover').modal();" class='btn btn-sm btn-danger-o external'style="border-radius: 100px;width:  9rem;font-size: .75rem">立即分享</a>
			</div>
		</div>
		<div class="block" style="padding:0.5rem;padding-top:1rem">
				  <div class="title bold c">邀请有礼</div>
				  <div class="order-express-page">
						<div class="fui-list-group express-list" style="background:none;padding:0;margin-top:0">
								<div ng-repeat="item in pagedata.app.saleset" class="fui-list">
									<div class="fui-list-inner" style="padding-right:0.3rem">
									<div class="text step" style="color:red">{{item.yao_jitypetitle}}</div>
									<div class="text time">邀请{{item.num||1}}人下载注册本APP，送{{item.typetitle}}{{item.fee}}个</div>
									</div>
								</div>
						</div>
					</div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div ng-if="pagedata.iswechat" id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div class='content'>请点击右上角<br/>通过【发送给朋友】<br/>邀请好友！！</div>
	</div>
	<div ng-if="!pagedata.iswechat" id="cover">
		<div class='content'>请“手机截图”分享图片给好友！</div>
	</div>
</div>
</div>
<div ng-if="pagedata.showposter" class="popup">
		<div class="popup-body">
			<div class="popup-center" style="width:80%;max-height:20rem">
				<i class="closed icon icon-cuowu" style="top: 108%;" ng-click="pagedata.showposter=false"></i>
				<div class="fui-content c" style="max-height:20rem;border: 1px solid #fdd8d6;border-radius:0.3rem;padding-bottom:0;background:#fff">
					<img ng-src="{{pagedata.posterimg ||'../addons/jy_saleapp/resource/images/bg.png'}}" style="border-radius:0.3rem;width:100%;height:20rem"/>
					<a ng-if="pagedata.iswechat"  class="btn btn-sm btn-danger-o external" style="line-height: 1.1rem;border-radius:1rem;margin:0.2rem;font-size:0.65rem;">长按保存图片</a>
					<a ng-if="!pagedata.iswechat" ng-click="pagedata.savePic()" class="btn btn-sm btn-danger-o external" style="line-height: 1.1rem;border-radius:1rem;margin:0.2rem;font-size:0.65rem;">点击保存图片</a>
				</div>
			</div>
		</div>
</div>
<script>
if(window.config.container=='wechat'){
	scope.pagedata.iswechat=true;
	scope.$evalAsync();
}
</script>
<script type="text/javascript">
scope.pagedata.upposter=function(){
	scope.get('jy_saleapp/getapp/upposter/id='+scope.pagedata.app.id,function(res){
		console.log(res)
		scope.pagedata.posterimg=res.posterimg;
	});
}
scope.pagedata.savePic=function(Url){
    Url = scope.pagedata.posterimg; //图片路径，也可以传值进来
    let triggerEvent = "touchstart"; //指定下载方式
    let blob=new Blob([''], {type:'application/octet-stream'}); //二进制大型对象blob
    let url = URL.createObjectURL(blob); //创建一个字符串路径空位
    let a = document.createElement('a'); //创建一个 a 标签
    a.href = Url;  //把路径赋到a标签的href上
    a.download = Url.replace(/(.*\/)*([^.]+.*)/ig,"$2").split("?")[0]; 
    let e = new MouseEvent('click', ( true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null));  
    a.dispatchEvent(e);
    //释放一个已经存在的路径（有创建createObjectURL就要释放revokeObjectURL）
    URL.revokeObjectURL(url);
}
</script>